package com.lib.online.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.lib.online.dao.LibDAO;
import com.lib.online.dao.jdbc.LibDaoHbrImpl;
import com.lib.online.model.*;

/**
 * @author ievgen_s
 */
@Service
public class UserService {
    
	@Resource(type=LibDaoHbrImpl.class)
    private LibDAO connector;  
    
    public UserService() {}    
    
    
    public User getUser(String name, String password) {
      
	return connector.getUser(name, password);
    }
    
    public void addUser(User user) {
    	
    	connector.addUser(user);
    }
    
  public void removeUser(User user) {
    	
    	connector.removeUser(user);
    }
    

    public List<Reading> getUserBooks(User user) {

	return connector.getUBooks(user);
    }
    
 public void addUserBook(String title, User user) {
    	
    	connector.addUBook(title, user);
    }
 
 public void removeUserBook(String title, User user) {
 	
 	connector.removeUBook(title, user);
 }


}